function getUrlParam(sUrl, sKey) {
    let paramArr=sUrl.split('?')[1].split('#')[0].split('&')
    let res=[]
    for(let i=0;i<paramArr.length;i++){
        let name=paramArr[i].split('=')[0]
        let key=paramArr[i].split('=')[1]
        if(name==sKey) res.push(key)
    }
    if(res.length==0) return{}
    return res
}
let sUrl='http://www.nowcoder.com?key=1&key=2&key=3&test=4#hehe'
let sKey='test'
let res=getUrlParam(sUrl,sKey)
console.log(res)